package bud.web.boardbud.dao;

import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import bud.vo.BoardFormDTO;
import bud.vo.ReplyDTO;

public class ReplyDaoiBatis implements IReplyDao{

	SqlMapClientTemplate mapper;
	
	public SqlMapClientTemplate getMapper() {
		return mapper;
	}

	public void setMapper(SqlMapClientTemplate mapper) {
		this.mapper = mapper;
	}
	
	@Override
	public int insertReply(ReplyDTO reply) {
		return mapper.update("Reply.insertReply", reply);
	}

	@Override
	public List<ReplyDTO> getRepList(BoardFormDTO form) {
		return mapper.queryForList("Reply.selectReplyList",form);
	}

	@Override
	public int deleteReply(ReplyDTO reply) {
		return mapper.delete("Reply.deleteReply",reply);
	}

	@Override
	public int getRepCount(Integer rep_ref_key) {
		return (Integer) mapper.queryForObject("Reply.getRepCount",rep_ref_key);
	}

}
